package topday1_9.mxdx9;

/**
 * @Auther:小陈的Java
 * 普通代码块
 *
 */
public class CodeBlockDemo {
    private int id;
    private String name;
    {
        this.id = 1;
        this.name = "张三";
        System.out.println("对构造方法的补充，每执行一次构造方法就执行一次代码块，代码块在构造方法执行前执行");
    }

    public CodeBlockDemo() {
        System.out.println("构造方法");
    }

    public static void main(String[] args) {
        CodeBlockDemo codeBlockDemo = new CodeBlockDemo();

    }
}
